package org.pp.admin.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Setter
@Getter
public class PpGoodsSkuEdite {

    @Setter
    @Getter
    public static class  Sku{

        @Schema(description = "sku的id")
        private Long skuId;

        @Schema(description = "库存")
        private Integer stock;

        @Schema(description = "sku封面图")
        private String cover;

        @Schema(description = "原价")
        private BigDecimal originPrice;

        @Schema(description = "售价")
        private BigDecimal price;

        @Schema(description = "选择的属性值")
        //尺寸 为 大号
        //{"尺寸":"大号"}
        @TableField(typeHandler = JacksonTypeHandler.class)
        private Map<String,String> attrInfo;

        @Schema(description = "商品名称")
        private String name;
    }

    @Schema(description = "商品id")
    private Long goodsId;

    List<Sku> skus;

}
